package com.luych.toolbox.data.service.convert;

import com.luych.toolbox.common.feign.view.data.service.DataTransporterHistoryView;
import com.luych.toolbox.common.service.base.BaseConvert;
import com.luych.toolbox.data.service.entity.DataTransporterHistory;
import org.springframework.beans.BeanUtils;

public class DataTransporterHistoryEntityToView implements BaseConvert<DataTransporterHistory, DataTransporterHistoryView> {

    @Override
    public DataTransporterHistoryView target() {
        return new DataTransporterHistoryView();
    }

    @Override
    public void accept(DataTransporterHistory source, DataTransporterHistoryView target) {
        BeanUtils.copyProperties(source, target, "tables", "tableMap");
        target.setTables(source.getTableMap());
    }
}
